package com.seafwg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author seafwg
 * @Date 2022/3/8 9:09 上午
 * @Version 1.0
 * @description 测试自定义拦截器
 */
@Controller
// @RequestMapping("/inter")
public class TestInterceptor {

    @RequestMapping("/test")
    public ModelAndView testInterceptor() {
        System.out.println("请求方法开始执行");
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("name", "seafwg");
        modelAndView.setViewName("index");
        System.out.println("modelAndView 以及设置完毕...");
        return modelAndView;
    }
}
